//
//  HMStoreImage.h
//  ImageLoader
//
//  Created by Le Ngoc Thanh on 8/23/13.
//  Copyright (c) 2013 Le Ngoc Thanh. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, HMStoreImageAutoRemove){
    HMStoreImageAutoRemoveNone,
    HMStoreImageAutoRemoveStartApp,
    HMStoreImageAutoRemoveOldData_ThreeDays,
};
@interface HMStoreImage : NSObject<NSCoding>{
    
}
@property (nonatomic) HMStoreImageAutoRemove removeType;
#pragma mark -
+ (HMStoreImage *)share;        // instance object
- (void)checkRemoveType;        // check and remove image with option remove type
+ (void)removeAllImage;         // remove all Image cache
- (void)saveManager;            // Save manager
#pragma mark - Manual
- (BOOL)saveData:(NSData *)data forOnlineUrl:(NSString *)online;        // save data for online link. YES - save success
- (BOOL)saveData:(NSData *)data forOnlineUrl:(NSString *)online atLocalLink:(NSString *)local;
- (NSString *)localFromOnlineString:(NSString *)online;                 // get link local from online link
- (BOOL)isDownloaded:(NSString *)online;                                // check downloaded from online link. YES is exist
- (void)addLocalUrl:(NSString *)local forOnlineUrl:(NSString *)online;
- (UIImage *)imageForOnlineUrl:(NSString *)online;                      // retrieve image from image For OnlineUrl
- (void)removeFromOnlineLink:(NSString *)online;                        // remove image from online link (use it)
- (void)removeLocal:(NSString *)local;                                  // remove image from local link (don't use if not need)

+ (NSString *)defaultStoreImage;
- (NSString *)createLocalName;
@end
